import { useUserStore } from '@/stores/counter.ts'
import ArrayUtils from '@/utils/ArrayUtils.ts'

const userStore = useUserStore()

export class RoleUtils {
  /**
   * 判断角色权限
   * @param role
   */
  static verifyRole(role: Array<number>) {
    if (userStore.getUser()) {
      return ArrayUtils.hasElement(role, userStore.getUser()?.role)
    }else {
      return false
    }
  }
}
